import { ref, watch } from "vue";

//     window.addEventListener('scroll', function () {
//     // 在此处添加滚动条改变时的处理逻辑
//     var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
//     if(scrollTop == 0){
//         document.getElementById("navi").classList.remove("navigation")
//         document.getElementById("navi").classList.add("navigation1")
//         document.getElementById("logo_img").setAttribute("src","./logo_1.png")
//     }else{
//         document.getElementById("navi").classList.add("navigation")
//         document.getElementById("navi").classList.remove("navigation1")
//         document.getElementById("logo_img").setAttribute("src","./logo.png")
//     }
// });
const scroll = ref(document.documentElement.scrollTop);

watch(scroll, (newValue, oldValue) => {
  console.log(`count changed from ${oldValue} to ${newValue}`);
});

export {
    watch,scroll
}

